package com.example.logindemo.slice;

import com.example.logindemo.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Text;

public class SecondAblilitySlice extends AbilitySlice {

    @Override
    public void onStart(Intent intent) {

        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_welcome_login);

        Text text = (Text) findComponentById(ResourceTable.Id_welcome_login);
        String usersname = intent.getStringParam("username");
        String password = intent.getStringParam("password");
        if (usersname.equals("Admin") && password.equals("123456")) {
            text.setText(usersname + "\n" + "欢迎进入界面");
        } else {
            text.setText("用户名或密码错误");
        }

    }
}
